package com.example.demo11.controller;

import com.example.demo11.domian.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController //默认是json 格式
public class HelloController {

    @RequestMapping("/hello")
    public String Index(){
        return "hello wrold!";
    }

    @RequestMapping("/getUser") //不能为空
    public User getUser(){
        User user = new User();
        user.setUserName("小明");
        user.setPassWorld("123456");
        return user;
    }
}
